package org.common.utils.nacos.entity;

/**
 * nacos地址
 * @author zhouzhibing
 * @date 2025/6/13
 */
public class NacosAddress {

    /**
     * nacos地址
     */
    private String host;

    /**
     * nacos命名空间
     */
    private String namespace;

    /**
     * nacos用户名
     */
    private String username;

    /**
     * nacos密码
     */
    private String password;

    /**
     * nacos访问密钥
     */
    private String accessKey;

    /**
     * nacos密钥
     */
    private String secretKey;

    private NacosAddress() {
    }

    public String getHost() {
        return host;
    }

    public String getNamespace() {
        return namespace;
    }

    public String getUsername() {
        return username;
    }

    public String getPassword() {
        return password;
    }

    public String getAccessKey() {
        return accessKey;
    }

    public String getSecretKey() {
        return secretKey;
    }

    public String toString() {
        return "NacosAddress{" +
                "host='" + host + '\'' +
                ", namespace='" + namespace + '\'' +
                ", username='" + username + '\'' +
                ", password='" + password + '\'' +
                ", accessKey='" + accessKey + '\'' +
                ", secretKey='" + secretKey + '\'' +
                '}';
    }

    public static Builder newBuilder() {
        return new Builder();
    }

    public static class Builder {
        private final NacosAddress nacosAddress = new NacosAddress();

        public Builder setHost(String host) {
            this.nacosAddress.host = host;
            return this;
        }

        public Builder setNamespace(String namespace) {
            this.nacosAddress.namespace = namespace;
            return this;
        }

        public Builder setUsername(String username) {
            this.nacosAddress.username = username;
            return this;
        }

        public Builder setPassword(String password) {
            this.nacosAddress.password = password;
            return this;
        }

        public Builder setAccessKey(String accessKey) {
            this.nacosAddress.accessKey = accessKey;
            return this;
        }

        public Builder setSecretKey(String secretKey) {
            this.nacosAddress.secretKey = secretKey;
            return this;
        }

        public NacosAddress build() {
            return nacosAddress;
        }

    }
}
